
* APPENDIX O - Does Partisanship Moderate the Post-Election Decline in Perceptual Accuracy?



clear all	
cd "${data}"	
use "data1.dta", clear 

gen observationlimit_CSES = . // in order to limit the bivariate model to the identical sample with the full model.
replace observationlimit_CSES = 1 if daysafter!=. & IMD5012_!=. & election_!=. & country_!=. & respondent!=. 

keep if observationlimit_CSES==1


gen partisan = .
replace partisan = 1 if IMD3005_1 == 1
replace partisan = 0 if IMD3005_1 == 0 | IMD3005_1 == 8


*Figure O1: Post-Election Accuracy Decline among Partisans and Non-Partisans (CSES)

eststo m_pid1: mixed c.IMD3007_ c.daysafter##c.IMD5012_##i.partisan || country_: || election_: partisan || respondent: IMD5012_ 
margins, dydx(IMD5012_) at(daysafter=(0(30)300)) over(partisan) post
est store estimatespid

marginsplot

graph save "${figures}/figureO1.gph", replace
graph export "${figures}/figureO1.png", replace 

* Table O1: Post-Election Accuracy Decline among Partisans and Non-Partisans (CSES)

cd "${tables}"
esttab m_pid1 using tableO1.tex , replace ///
b(3) se(3) nogap transform(ln*: exp(2*@) 2*exp(2*@))





**************************************************
****				BES PARTISANSHIP      ********
**************************************************


clear all
cd "${data}"
use "data2.dta", clear


gen partisan = . 
replace partisan = 0 if pid3 == 0 // independent
replace partisan = 1 if pid3== 1 | pid3==2 | pid3==3 | pid3==4 | pid3==5 // Conservative, Labour, Libdem, UKIP, other 

keep if vague >2 & vague <8
	
xtset id vague

eststo m_partisan0: xtreg accuracy_index i.wave_ if partisan==0, fe vce(cluster id)
margins, at(wave_=(3 4 5 6 7)) post
est store pid0


eststo m_partisan1: xtreg accuracy_index i.wave_ if partisan==1, fe vce(cluster id)
margins, at(wave_=(3 4 5 6 7)) post
est store pid1

* Figure O2: Over-Time Evolution of Perceptual Error (BESIP)

coefplot pid0 pid1, ///
    vertical ///
    recast(connected) ///
    rename( ///
        1._at="Sept/Oct'14" ///
        2._at="Mar'15" ///
        3._at="Apr/May'15" ///
        4._at="May '15" ///
        5._at="Apr/May'16" ///
    ) ///
    yscale(range(1.5(0.15)2))

graph save "${figures}/figureO2.gph", replace
graph export "${figures}/figureO2.png", replace 

* Table 02. Evolution of Perceptual Error Among Partisans and Non-Partisans (BESIP)

cd "${tables}"

esttab m_partisan0 m_partisan1 using table02.tex , replace ///
b(3) se(3) nogap
